<!DOCTYPE html>
<html lang="en"  style="width:100%;height:100%;">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    <link rel="stylesheet" href="../css/web.css">
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <!-- 调用百度接口 -->
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
    <script type="text/javascript" src="../../assets/js/wechat/modifyUrlpath.js"></script>
    <script type="text/javascript" src="../../assets/js/wechat/getUrlParam.js"></script>
   	<script type="text/javascript" src="../../assets/js/wechat/jssdk_api.js"></script>
    <script type="text/javascript" src="../../assets/js/wechat/wechatApi.js"></script>
</head>
<body>
	<input type="button" value="跳转到二维码" style="font-size:26px;width:180px;height:180px;"  id="toScene"/>
</body>
<script type="text/javascript">	
	$(function(){
		code = UrlParm.parm("code");
		if(code == null || typeof(code) == "undefined"){
			return ; 
		} 
		getUserId(code, suc_userid);
	})
	function suc_userid(data){
			alert(data);
			if(data.retcode == 0 || data.retcode == '0'){  
				userId = data.result;
				SetCookie("userId", userId);
			}else{
				var cookie_userId = GetCookie("userId");
				if (cookie_userId == null || typeof(cookie_userId) == "undefined"){
					wx.closeWindow();
				}else{
					userId = cookie_userId;
				} 
			}
			/* $.ajax({
				url:vUrlPath + 'wechat/sendMsg?' + vUrlParam,
				type:'post',  
				data:{
					"userId":userId
				}
				async:false,  
				dataType:'json', 
				success:function(data) {
					
				},
				error:function(data) {
					console.log("can not get UserId");
				}
			});  */
		}
</script>
</html>